
# a+b+c = 1000, 且a^2+b^2=c^2, 求a, b, c组合

import time

# startTime = time.time()
# for a in range(0, 1001):
#     for b in range(0, 1001):
#         for c in range(0, 1001):
#             if a+b+c == 1000 and a * a + b * b == c * c:
#                 print("a=%d, b=%d, c= %d" % (a, b, c))
#
# endTime = time.time()
# print("costTime=%d" % (endTime-startTime))

startTime = time.time()
for a in range(0, 1001):
    for b in range(0, 1001):
        c = 1000 - a - b
        if a ** 2 + b ** 2 == c ** 2:
            print("a=%d, b=%d, c= %d" % (a, b, c))

endTime = time.time()
print("costTime=%d" % (endTime-startTime))
